package com.demo.service.impl;

import com.demo.service.FileService;
import com.demo.util.DataParse;
import com.demo.util.POIUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

@Service
public class FileServiceImpl implements FileService {


    @Override
    public List<DataParse> getDataFromFile(MultipartFile file) {

        List<DataParse> result=null;
        try {
            result =  POIUtils.readExcel(file);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return result;
    }

    @Override
    public void writeIntoDataBase(List<DataParse> dataParseList) {

    }

}
